let words =["Aasdfghjkl","Qwertyuiop","zZxcvbnm"]
var findWords = function(words) {
    const list = [];
    const rowIdx = "12210111011122000010020202";
    for(let word of words){
        let idx = rowIdx[word[0].toLowerCase().charCodeAt() - 'a'.charCodeAt()]
        let result = true
        for(let i=1;i<word.length;i++){
            if((rowIdx[word[i].toLowerCase().charCodeAt()-'a'.charCodeAt()])!==idx){
                result = false
                break;
            }
        }

        if(result){
            list.push(word)
    }
    }
    return list
}
console.log(findWords(words));
